/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.kj.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import javax.validation.constraints.NotNull;

/**
 * kj_activity_commentEntity
 * @author hzy
 * @version 2021-07-12
 */
@Table(name="kj_activity_comment", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="activity_id", attrName="activityId", label="活动id"),
		@Column(name="activity_name", attrName="activityName", label="活动名", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="评论内容"),
		@Column(name="process_status", attrName="processStatus", label="审核状态"),
		@Column(name="member_id", attrName="kjMember.id", label="用户ID"),
		@Column(name="member_name", attrName="kjMember.name", label="用户名", queryType=QueryType.LIKE),
		@Column(name="comment_time", attrName="commentTime", label="评论时间"),
		@Column(name="head_img", attrName="kjMember.headimg", label="头像"),
		@Column(name="comment_type", attrName="commentType", label="评论类别"),
		@Column(name="reply", attrName="reply", label="回复"),
		@Column(includeEntity=DataEntity.class),
	}, joinTable={
		@JoinTable(type=Type.LEFT_JOIN, entity= KjMember.class, alias="m",
				on="m.id = a.member_id",
				columns={
				@Column(name="id", attrName = "id"),
				@Column(name="name", attrName = "name",queryType=QueryType.LIKE),
				@Column(name="headimg", attrName = "headimg")
				}),

		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= KjActivity.class, alias="ka",
				on="ka.id = a.activity_id",
				columns={
				@Column(includeEntity = KjActivity.class)})
}, orderBy="a.update_date DESC"
)
public class KjActivityComment extends DataEntity<KjActivityComment> {
	public static final String ACCEPT = "1";
	public static final String REJECT = "2";
	private static final long serialVersionUID = 1L;
	private String activityId;		// 活动id
	private String activityName;		// 活动名
	private String content;		// 评论内容
	private String processStatus;		// 审核状态
	// 	private String memberId;		// 用户ID
	//  private String memberName;		// 用户名
	private Date commentTime;		// 评论时间
	private KjMember kjMember;
	private String commentType;
	private String reply;
	private KjActivity kjActivity;

	public KjActivityComment() {
		this(null);
	}

	public KjActivityComment(String id){
		super(id);
	}

	@Length(min=0, max=64, message="活动id长度不能超过 64 个字符")
	public String getActivityId() {
		return activityId;
	}

	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	@Length(min=0, max=255, message="活动名长度不能超过 255 个字符")
	public String getActivityName() {
		return activityName;
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	@Length(min=0, max=255, message="评论内容长度不能超过 255 个字符")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Length(min=0, max=1, message="审核状态长度不能超过 1 个字符")
	public String getProcessStatus() {
		return processStatus;
	}

	public void setProcessStatus(String processStatus) {
		this.processStatus = processStatus;
	}

	@NotNull
	public KjMember getKjMember() {
		return kjMember;
	}

	public void setKjMember(KjMember kjMember) {
		this.kjMember = kjMember;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCommentTime() {
		return commentTime;
	}

	public void setCommentTime(Date commentTime) {
		this.commentTime = commentTime;
	}


	public String getCommentType() {
		return commentType;
	}

	public void setCommentType(String commentType) {
		this.commentType = commentType;
	}

	public String getReply() {
		return reply;
	}

	public void setReply(String reply) {
		this.reply = reply;
	}

	public KjActivity getKjActivity() {
		if(kjActivity == null){
			kjActivity = new KjActivity();
		}
		return kjActivity;
	}

	public void setKjActivity(KjActivity kjActivity) {
		this.kjActivity = kjActivity;
	}
}
